1. Field of the Invention
This invention relates to an apparatus and method for determining linear and rotational position using an encoder and, more particularly, to an apparatus and method for determining absolute linear and rotational position using such an encoder.
2. Description of the Related Art
Encoders are used in a number of practical applications. Linear encoders are used to indicate the linear position of mechanically movable members, and rotary encoders indicate the angular position of rotating elements such as the shaft of a motor. For example, encoders may be used to measure the position of a robotic arm. Encoders may also be used in place of a potentiometer in airplanes or other navigational craft. Additionally, U.S. Pat. No. 5,036,468 describes the use of an encoder on trains.
There are two basic types of encoders: incremental encoders and absolute encoders. Incremental encoders employ external circuitry to count pulses, and the incremental position is defined by the number of pulses counted in relation to a datum or starting point. A fundamental problem with incremental encoders arises when a power failure or interruption occurs so that the datum is no longer available as a reference point. In other words, an isolated or static reading of incremental position does not disclose an actual or absolute position because incremental position is relative to an initial reading.
Absolute encoders, on the other hand, independently determine an actual or absolute position without relying on datum or external circuitry. Therefore, an isolated or static reading of absolute position overcomes the fundamental limitation of incremental encoders by always providing a reading of actual position.
Absolute position encoders utilize a sequence of positional codes stored in binary form on a code plate and a plurality of sensors that read the positional codes. In linear applications, the code plate is an elongated member having a plurality of linearly arranged parallel code tracks. By contrast, a rotary encoder utilizes a code disk with a plurality of concentric code tracks. Code sensors read the positional codes optically, magnetically, by direct contact or by other means known in the art. However, using nonoptical techniques may decrease the life of the sensors and the code disk as a result of friction and/or vibration. Thus, optical encoders are usually preferable to non-optical encoders due to easier computer interfacing, improved accuracy and durability, and increased reliability.
Conventional rotary optical encoders consist of a code disk, a source of light, and an array of light sensors or detectors. As the disk rotates, the positional codes on the disk are read by the light sensors. The code may then be translated into a number that represents the rotation angle of the shaft, typically in degrees.
The positional codes generally used on code disks are known as gray codes. A gray code is a modified binary code that allows only one bit to change at a time as the disc rotates between angular positions. This feature is important for optical encoders because of the ambiguities that would arise if the encoder were to stop exactly halfway between two positions and two or more bits were changing at that time. Since only one bit changes at a time, gray code encoders have a resolution of plus or minus one bit. Resolution is the degree of accuracy in determining absolute position. The following table illustrates the relationship between decimal, binary, and gray code from "0" to "9":
______________________________________ DECIMAL BINARY GRAY ______________________________________ 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101 ______________________________________
In constructing code plates using gray code, a significant limitation requires the number of detectable positions (referred to herein as the "count") of the code plate to be a power of two (i.e., 2, 4, 8, 16, etc.). If a count other than a power of two is coded on the code plate, more than one bit will undesirably change during the transition from the last positional code on the plate to the first positional code on the plate. For example, to construct a code disc with 5 positions, the first position on the disc is "0" (0000) and the last position is "4" (0110), and thus, in transitioning from the last position "4" to the first position "0" on the code disc, two bits change. In contrast, a rotary encoder designed to read eight positions, i.e., a count of 8, for example, will have a resolution of one bit because only one bit changes at a time, even as the disk begins a new revolution and rotates from position 7 ("0100") to position 0 ("0000"). Even if the sensors cannot identify the changing bit, the absolute position on the code disk must either be position 7 or position 0 because the other bits are identifiable. Thus, an encoder designed for a position count equal to any power of two will have a resolution of plus or minus one bit at all times.
The requirement that the number of positions of the count equal a power of two profoundly limits the utility of conventional gray code optical encoders. With more than one bit changing at a time on the code disk, the encoder cannot accurately determine absolute position within one bit. Therefore, the prior art methods of determining absolute position fail to maintain a resolution of plus or minus one bit for the vast majority of potential applications.
Perhaps the most common practical application for encoders is a 360 count disk for determining angular position (in degrees) about a shaft. Significantly, more than one bit will change at a time as a conventional 360 count disk rotates clockwise from the last position to the first position because the number 360 is not a power of two. Moreover, a conventional gray code rotary encoder may be divided into 256 (2.sup.8) positions or 512 (2.sup.9) positions, but not 360 positions or any other number of positions between 256 and 512 without substantially compromising its resolution. Because so many practical applications require an encoder that can read 360 degrees (or positions), a reading from a conventional 512 count encoder has been divided by 1,422 to get a number representing the degree angle of the shaft. However, this method is susceptible to an accumulation of mathematical precision errors, such as rounding errors inherent in the division step. Further, using a 512 count encoder rather than a 360 count encoder may involve reading or calibration errors that would not be present in an encoder designed for 360 positions.
Another problem in the prior art involves the slow recognition of incorrect readings. For example, when a sensor becomes nonfunctional in an optical encoder, the encoder may give incorrect readings. Before this faulty sensor is replaced, however, the incorrect readings may go unnoticed for quite some time. Such inefficiency obviously detracts from the effective performance of the encoder.